<script>
  init({
    title: 'Custom AJAX',
    desc: 'Use <code>ajax</code> option to replace ajax call. Should implement the same API as jQuery ajax method.',
    links: ['bootstrap-table.min.css'],
    scripts: ['bootstrap-table.min.js']
  })
</script>

<table
  id="table"
  data-toggle="table"
  data-height="460"
  data-ajax="ajaxRequest"
  data-search="true"
  data-side-pagination="server"
  data-pagination="true">
  <thead>
    <tr>
      <th data-field="id">ID</th>
      <th data-field="name">Item Name</th>
      <th data-field="price">Item Price</th>
    </tr>
  </thead>
</table>

<script>
  // your custom ajax request here
  function ajaxRequest(params) {
    // params data you need
    console.log(params.data)
    // here we just use setTimeout
    setTimeout(function () {
      params.success({
        total: 100,
        rows: [{
          'id': 0,
          'name': 'Item 0',
          'price': '$0'
        }]
      })
    }, 1000)
  }
</script>
